<template>
	<div>
		myMath:{{mymathAbout.sub}}
		big:{{bigSum}}
		<button @click="increment(n)">增加</button>
		<button @click="incrementOdd(n)">奇数增加</button>
	</div>
</template>

<script>
	import { mapGetters, mapState, mapActions, mapMutations } from 'vuex'
	export default {
		name:'MyMathMapper',
		data() {
			return {
				n:1, //用户选择的数字
			}
		},
		methods: {
			...mapActions({incrementOdd: 'addOdd'}),
			...mapMutations({increment:'ADD'}),
			// increment(){
			// 	this.$store.commit('ADD',this.n)
			// },
			// incrementOdd(){
			// 	this.$store.dispatch('addOdd',this.n)
			// },
		},
		computed: {
			...mapState({mymathAbout:'mymathAbout'}),
			...mapGetters(['bigSum'])
		},
		mounted() {
			console.log('MyMathMapper',this)
		},
	}
</script>

<style lang="css">
	button{
		margin-left: 5px;
	}
</style>
